package com.qdxwx.data.service.live;

import com.qdxwx.common.page.PageRequest;
import com.qdxwx.data.mapper.live.LiveCourseMapper;
import com.qdxwx.models.course.Course;
import com.qdxwx.models.course.CourseNode;
import com.qdxwx.models.course.CourseQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Qdx NetSchool Platform
 * @author qdxwx
 * @updateTime 2022/5/25
 * @description
 */
@Service
public class LiveCourseServiceImpl implements LiveCourseService {

    @Autowired
    private LiveCourseMapper liveCourseMapper;
    @Override
    public List<Course> queryWebLiveCourseListPage(CourseQuery courseQuery, PageRequest page) {
        return liveCourseMapper.queryWebLiveCourseListPage(courseQuery,page);
    }

    @Override
    public List<CourseNode> getNextByCourseId(int courseId) {
        return liveCourseMapper.selectNextLiveByCourseId(courseId);
    }

    @Override
    public int queryWebLiveCourseListPageCount(CourseQuery courseQuery) {
        return liveCourseMapper.queryWebLiveCourseListPageCount(courseQuery);
    }
}
